using System;
using System.Collections;
using MFGps.Data;

namespace MFGps
{
    public interface IGpsDevice : IDisposable
    {
        event PositionChangedDelegate PositionChanged;
        event WaypointEncounteredDelegate WaypointEncountered;

        int BaudRate { get; }
        string ComPort { get; }

        bool WaypointNotificationEnabled { get; set; }
        bool PositionUpdateEnabled { get; set; }

        float Altitude { get; }
        
        float Heading { get; }

        float SpeedKmh { get; }
        float SpeedMs { get; }
        float SpeedMph { get; }
        float SpeedKts { get; }

        DegreeTime Latitude { get; }
        DegreeTime Longitude { get; }

        DateTime UtcTime { get; }
        DateTime LocalTime { get; }

        byte SatellitesInView { get; }
        FixStatus SatelliteFixStatus { get; }
        ArrayList Satellites { get; }

        RangeError RangeErrorStatistics { get; }
        bool CollectRangeErrorStatistics { get; set; }

        bool AllowDeadReckoning { get; set; }

        ArrayList Waypoints { get; }

        void AddWaypoint(Waypoint wp);
        void RemoveWaypoint(Waypoint wp);
        void RemoveWaypoint(string wp);

        bool Connect();
        bool Connect(string comPort);
        bool Connect(string comPort, int baudRate);
        bool Connect(string comPort, int baudRate, DateTime localTime);
        bool Connect(string comPort, int baudRate, bool raisePositionEvent);
        bool Connect(string comPort, int baudRate, bool raisePositionEvent, DateTime localTime);
        bool Connect(string comPort, int baudRate, bool raisePositionEvent, bool raiseWaypointEvent);
        bool Connect(string comPort, int baudRate, bool raisePositionEvent, bool raiseWaypointEvent, DateTime localTime);

        void Disconnect();

        void ChangeBaudRate(int newBaud);
        void ChangeUpdateRate(int newRate);
    }
}
 